﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class SpanCollectionExtensions
    {
        public static bool Exists(this SpanCollection spanCollection, string spanIdOrNameOrValueorClass, bool extension = true)
        {
            return spanCollection.Exists(Find.ById(spanIdOrNameOrValueorClass)) ||
                spanCollection.Exists(Find.ByName(spanIdOrNameOrValueorClass)) ||
                spanCollection.Exists(Find.ByValue(spanIdOrNameOrValueorClass)) ||
                spanCollection.Exists(Find.ByClass(spanIdOrNameOrValueorClass)) ||
                spanCollection.Exists(Find.ByLabelText(spanIdOrNameOrValueorClass));
        }
    }
}